<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="SemaforoCreateDlg" widgetVar="SemaforoCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.CreateSemaforoTitle}">
            <h:form id="SemaforoCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{semaforoController.selected != null}">
                        <p:outputLabel value="#{bundle.CreateSemaforoLabel_idSemaforo}" for="idSemaforo" />
                        <p:inputText id="idSemaforo" value="#{semaforoController.selected.idSemaforo}" title="#{bundle.CreateSemaforoTitle_idSemaforo}" required="true" requiredMessage="#{bundle.CreateSemaforoRequiredMessage_idSemaforo}"/>
                        <p:outputLabel value="#{bundle.CreateSemaforoLabel_color}" for="color" />
                        <p:inputText id="color" value="#{semaforoController.selected.color}" title="#{bundle.CreateSemaforoTitle_color}" />
                        <p:outputLabel value="#{bundle.CreateSemaforoLabel_limiteInferior}" for="limiteInferior" />
                        <p:inputText id="limiteInferior" value="#{semaforoController.selected.limiteInferior}" title="#{bundle.CreateSemaforoTitle_limiteInferior}" />
                        <p:outputLabel value="#{bundle.CreateSemaforoLabel_limiteSuperior}" for="limiteSuperior" />
                        <p:inputText id="limiteSuperior" value="#{semaforoController.selected.limiteSuperior}" title="#{bundle.CreateSemaforoTitle_limiteSuperior}" />
                        <p:outputLabel value="#{bundle.CreateSemaforoLabel_idIndicador}" for="idIndicador" />
                        <p:selectOneMenu id="idIndicador" value="#{semaforoController.selected.idIndicador}" required="true" requiredMessage="#{bundle.EditSemaforoRequiredMessage_idIndicador}">
                            <f:selectItems value="#{indicadorController.itemsAvailableSelectOne}"
                                           var="idIndicadorItem"
                                           itemValue="#{idIndicadorItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{semaforoController.create}" value="#{bundle.Save}" update="display,:SemaforoListForm:datalist,:growl" oncomplete="handleSubmit(args,'SemaforoCreateDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="SemaforoCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
